﻿<shared:UserControlBase x:Class="HP.Cachalote.WPF.UserControls.FinishedTodoItemTreeViewUserControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:shared="clr-namespace:HP.Cachalote.WPF.Shared"
             xmlns:userControls="clr-namespace:HP.Cachalote.WPF.UserControls"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300" 
             DataContext="{Binding FinishedTodoItemTreeView, Source={StaticResource Locator}}">
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/Skins/StoryBoards/FinishedTodoItemTreeViewUserControlStoryBoard.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </UserControl.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition />
        </Grid.RowDefinitions>
        <Grid Width="200" HorizontalAlignment="Left">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
            <Button Margin="4" Content="{Binding TodoItems.Count}" ContentStringFormat="{}{0} Done Item(s)" 
                    Click="treeViewlVisibilityControlButton_Click" Padding="12,0,12,0" Height="35" Width="Auto" />
            <Button Margin="4" Grid.Column="2" Content="Delete all" Command="{Binding DeleteAllCommand}" Padding="12,0,12,0" Height="35" Width="Auto" />
        </Grid>
        <Grid Grid.Row="2">
            <TreeView Grid.Row="2" Margin="0" x:Name="TreeViewTodoItems" BorderThickness="0" 
                    ScrollViewer.HorizontalScrollBarVisibility="Disabled" Height="120"
                    ItemsSource="{Binding TodoItems}" Visibility="Collapsed" RenderTransformOrigin="0.5,0.5">
            	<TreeView.RenderTransform>
                    <TransformGroup>
                        <ScaleTransform/>
                        <SkewTransform/>
                        <RotateTransform/>
                        <TranslateTransform Y="10"/>
                    </TransformGroup>
                </TreeView.RenderTransform>
                <TreeView.ItemTemplate>
                    <DataTemplate>
                        <userControls:FinishedTodoItemTreeViewItemUserControl DataContext="{Binding}" />
                    </DataTemplate>
                </TreeView.ItemTemplate>
            </TreeView>
        </Grid>
    </Grid>
</shared:UserControlBase>
